package com.raindrop.utils;

import java.io.IOException;
import java.io.InputStream;

/**
 * bat编译工具
 */
public class InvokeBatUtil {

    public static void runbat(String cmd) {
        try {
            System.out.println("bat 编译开始");
            Process ps = Runtime.getRuntime().exec(cmd);
            InputStream in = ps.getInputStream();
            in.close();
            ps.waitFor();
            System.out.println("bat 编译完成");
        } catch (IOException ioe) {
            ioe.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        String cmd = "E:\\tools\\1.0\\WSKBuild\\Bat\\Main.bat E:\\tools\\unity\\Editor E:\\file\\upload_dir\\developer\\build\\WSK_UploadFile\\5a69931d8fa6a5390cbed329\\123_1516868381470 E:\\tools\\1.0\\Assets \"{\"Platform\":[\"Pad\",\"Pico\"],\"scenePaths\":[\"Test1\",\"Assets/Test1.unity\"],\"projectTime\":1516868381470,\"version\":\"1.1.2\",\"productName\":\"123\",\"BundleIdentifier\":\"1\"}\" E:\\file\\upload_dir\\developer\\build\\WSK_UploadFile_Build_APK\\5a69931d8fa6a5390cbed329 E:\\tools\\1.0\\WSKBuild\\Tools 1231.1.2";
        runbat(cmd);
    }
}